const { DataTypes, BaseModel } = require('../baseModel')

class TagPosts extends BaseModel {}

TagPosts.initModel(
  {
    post_id: {
      type: DataTypes.INTEGER,
      comment: '文章id',
    },
    post_name: {
      type: DataTypes.STRING,
      comment: '文章标题',
    },
    tag_name: {
      type: DataTypes.STRING,
      comment: '标签名称',
    },
    tag_id: {
      type: DataTypes.INTEGER,
      comment: '标签id',
    },
  },
  {
    tableName: 'xs_tag_posts',
    comment: '文章和标签关系表',
  }
)

// TagPosts.sync({
//   alter: true,
// })

module.exports = TagPosts
